﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using PracticeChart.DataTypes;

namespace PracticeChart.Popups
{
    public partial class NewPatient : Form
    {
        Main main;
        public NewPatient()
        {
            InitializeComponent();
        }
        public NewPatient(Main m)
        {
            InitializeComponent();
            main = m;
            patientIdLabel.Text = main.NumberOfPatients.ToString();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
            bool b = false;
            if (brightonResidentTextBox.Text == "Y") b = true;
            PatientData pt = new PatientData(b, lastTextBox.Text, firstNameTextBox.Text, middleTextBox.Text, unknownNameCheckBox.Checked,
                Convert.ToInt32(ssnTextBox.Text), addrTextBox1.Text, addrTextBox2.Text, unknownAddrCheckBox.Checked, sexCombo.SelectedText, internationalTextBox.Checked,
                ageType.SelectedText, cityStateZipTextBox.Text.Split('/')[0], cityStateZipTextBox.Text.Split('/')[1], cityStateZipTextBox.Text.Split('/')[2],
                countyTextBox.Text, Convert.ToInt32(phoneTextBox.Text), Convert.ToInt32(dobTextBox.Text), Convert.ToInt32(ageTextBox.Text), 
                dnrCollection.SelectedText, Convert.ToInt32(weightTextBox.Text), weightCombo.SelectedText, barriersToCareCombo.SelectedText, raceCombo.SelectedText);
        }
    }
}
